<?php
class Dashboard extends Controller {
	
	function __construct() {
		parent::__construct();
		Session::init();
		$isLogin = Session::get('isLogin');
		if (!$isLogin) {
			Session::destroy();
			header('location: ../login');
			exit;
		}
		
		$this->view->js = array('dashboard/js/index.js');
	}
	
	function index() {
		$this->view->render('dashboard/index');
	}
	
	function logout() {
		Session::destroy();
		header('location: ../login');
		exit;
	}
	
	function xhrInsert() {
		$this->model->xhrInsert();
	}
	
	function xhrGetListings() {
		$this->model->xhrGetListings();
	}
	
	function xhrDeleteListings() {
		$this->model->xhrDeleteListings();
	}
}